<?php

namespace Gds\ArticleBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Gds\ArticleBundle\Entity\Inventaire
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Gds\ArticleBundle\Entity\InventaireRepository")
 */
class Inventaire
{
     /**
     * @ORM\OneToMany(targetEntity="Gds\ArticleBundle\Entity\LigneInventaire", mappedBy="inventaire")
     */
    private $lignesInventaire; // Ici commentaires prend un "s", car un article a plusieurs commentaires !
     /**
     * @ORM\ManyToOne(targetEntity="Gds\ArticleBundle\Entity\Departement", inversedBy="inventaires")
     * @ORM\JoinColumn(nullable=false)
     */
    private $departement;
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime $date
     *
     * @ORM\Column(name="date", type="datetime")
     */
    private $date;

    /**
     * @var string $reference
     *
     * @ORM\Column(name="reference", type="string", length=255)
     */
    private $reference;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set date
     *
     * @param \DateTime $date
     * @return Inventaire
     */
    public function setDate($date)
    {
        $this->date = $date;
    
        return $this;
    }

    /**
     * Get date
     *
     * @return \DateTime 
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Set reference
     *
     * @param string $reference
     * @return Inventaire
     */
    public function setReference($reference)
    {
        $this->reference = $reference;
    
        return $this;
    }

    /**
     * Get reference
     *
     * @return string 
     */
    public function getReference()
    {
        return $this->reference;
    }

    /**
     * Set departement
     *
     * @param Gds\ArticleBundle\Entity\Departement $departement
     * @return Inventaire
     */
    public function setDepartement(\Gds\ArticleBundle\Entity\Departement $departement)
    {
        $this->departement = $departement;
    
        return $this;
    }

    /**
     * Get departement
     *
     * @return Gds\ArticleBundle\Entity\Departement 
     */
    public function getDepartement()
    {
        return $this->departement;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->lignesInventaire = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add lignesInventaire
     *
     * @param Gds\ArticleBundle\Entity\LigneInventaire $lignesInventaire
     * @return Inventaire
     */
    public function addLignesInventaire(\Gds\ArticleBundle\Entity\LigneInventaire $lignesInventaire)
    {
        $this->lignesInventaire[] = $lignesInventaire;
    
        return $this;
    }

    /**
     * Remove lignesInventaire
     *
     * @param Gds\ArticleBundle\Entity\LigneInventaire $lignesInventaire
     */
    public function removeLignesInventaire(\Gds\ArticleBundle\Entity\LigneInventaire $lignesInventaire)
    {
        $this->lignesInventaire->removeElement($lignesInventaire);
    }

    /**
     * Get lignesInventaire
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getLignesInventaire()
    {
        return $this->lignesInventaire;
    }
}
